﻿using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using System.Linq.Expressions;

namespace Microsoft.EntityFrameworkCore
{
    /// <summary>
    /// 自定义类型转成 string 转换器
    /// </summary>
    public class CustomToStringConverter<TModel> : ValueConverter<TModel, string>
    {
        public CustomToStringConverter(
           [NotNull] Expression<Func<TModel, string>> convertToProviderExpression,
           [NotNull] Expression<Func<string, TModel>> convertFromProviderExpression,
           [CanBeNull] ConverterMappingHints mappingHints = null)
           : base(convertToProviderExpression, convertFromProviderExpression, mappingHints)
        {
        }
    }
}
